home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / shape.man < prev    next >
Encoding:
Text File  |  1993-09-05  |  2.3 KB  |  82 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      Shape - some shape classes
  7.  
  8. SYNOPSIS
  9.      #include <Shape.h>
  10.  
  11.      struct Point
  12.      struct Line : Point
  13.      struct Rectangle : Point
  14.  
  15. DESCRIPTION
  16.      Graphical programs often refer to (x,y) coordinates,
  17.      (x1,y1,x2,y2) areas, etc..  This module provides these as simple
  18.      structs.
  19.  
  20. CLASSES
  21.      A Point is an (x,y) coordinate.
  22.      A Line is a Point with another Point defining its end.
  23.      A Rectangle is a Point with a width and height.  Exactly which
  24.          corner the "Point" coordinate refers to is not defined, but
  25.          determined by usage.  Usually the top-left is inferred.
  26.  
  27. CLASS MEMBERS
  28.   Point::
  29.      int x,y
  30.        The coordinates.
  31.      Point()
  32.        Create the point at the origin (0,0).
  33.      Point(int X,int Y)
  34.        Create the point with the given coordinates.
  35.      void MoveTo(int X,int Y)
  36.        Move the point to the given coordinates.
  37.      void MoveBy(int X,int Y)
  38.        Move the point by the given amounts.
  39.      void Bound(const Rectangle& R)
  40.        Bound the point to the given area.
  41.        The point moves back to the closest edge if out of bounds.
  42.  
  43.   Line::
  44.      Line()
  45.        Create a line from (0,0) to (1,0)
  46.      Line(int x1,int y1,int x2, int y2)
  47.        Create a line from (x1,y1) to (x2,y2)
  48.      Point end
  49.        The point at the end of the line
  50.  
  51.   Rectangle::
  52.      int w,h
  53.        The width and height of the point
  54.      Rectangle()
  55.        Create a 1 by 1 rectangle with its corner at the origin.
  56.      Rectangle(int X,int Y,int W, int H)
  57.        Create a W by H rectangle with its corner at (X,Y).
  58.      void Area(int W,int H)
  59.        Set the rectangles area.
  60.      int Area()
  61.        Calculate the rectangles area (in square units).
  62.      Rectangle& operator*= (int m)
  63.        Multiply the size of the rectangle by m.
  64.  
  65. BUGS
  66.      These structs should be used more in the AMS Library.
  67.  
  68. AUTHOR
  69.      Warwick Allison, 1992.
  70.      warwick@cs.uq.oz.au
  71.  
  72. COPYING
  73.      This functionality is part of the Atari Machine Specific Library,
  74.      and is Copyright 1992 by Warwick W. Allison.
  75.  
  76.      The Atari Machine Specific Library is free and protected under the
  77.      GNU Library General Public License.
  78.  
  79.      You are free to copy and modify these sources, provided you acknowledge
  80.      the origin by retaining this notice, and adhere to the conditions
  81.      described in the GNU LGPL.
  82.